﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SD007
{
    public partial class MetricsForm : Form
    {
        public MetricsForm(ErrorType error)
        {
            int x = 20;
            int y = 20;
            InitializeComponent();
            this.Text = error.TypeName;
            this.txtDesc.Text = error.Description;
            foreach (var metric in error.Metrics)
            {
                Label title = new Label();
                title.Text = metric.Item1.Name + ": ";
                title.Left = x;
                title.Top = y;
                title.Parent = this;
                ToolTip tip = new ToolTip();
                tip.SetToolTip(title, metric.Item1.Description);
                Label value = new Label();
                value.Text = metric.Item2;
                value.Left = x + title.Width;
                value.Top = y;
                value.Parent = this;
                y = y + title.Height + 5;
                title.Visible = true;
                value.Visible = true;
            }
        }


    }
}
